<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>路径</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/areaCodes.js"></script>
<script src="https://code.jquery.com/jquery-1.8.3.js"></script>
<script type="text/javascript">
	function showRouteList() {
		window.location ="${pageContext.request.contextPath}/routeList.action"
	}
</script>
</head>
<body>
	<!-- 增加物流路径  -->
	<form action="${pageContext.request.contextPath }/addRoute.action" method="post">
		<tr>
			<td>选择起始地区：
				<select id="Province" name="Province"></select>
				<select id="City" name="City"></select>
				<select id="Area" name="Area"></select>
				<script type="text/javascript">
					addressInit('Province', 'City', 'Area');
				</script>
			</td>
		</tr>
		<tr>
			<td>选择终点地区：
				<select id="Province1" name="Province1"></select>
				<select id="City1" name="City1"></select>
				<select id="Area1" name="Area1"></select>
				<script type="text/javascript">
					addressInit('Province1', 'City1', 'Area1');
				</script>
			</td>
		</tr>
		<tr>
			<td>
				距离<input type="text" name="distance">
			</td>
			<td>
				<input type="submit" value="提交">
			</td>
		</tr>
	</form>
 
	
	<!-- 物流路径list  -->
	<div> 
		<table>
			<thead>
				<tr>
					<th>订单ID</th>
					<th>始发地</th>
					<th>目的地</th>
					<th>重量</th>
					<th>货物种类</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${routeList}" var="order">
					<tr>
						<td>${order.routeID }</td>
						<td>${order.adminID }</td>
						<td>${order.start }</td>
						<td>${order.end }</td>
						<td>${order.distance}</td>		
						<td><a href="${pageContext.request.contextPath }/deleteRoute.action?routeID=${order.routeID }">删除</a></td>		
						<td><a href="${pageContext.request.contextPath }/findAllRouteNode.action?routeID=${order.routeID }">编辑</a></td>				
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
</body>
</html>